struct BlockData
{
public:
	byte Data;
	Point2i Offset;

	BlockData(byte data, int x, int y) :
		Data(data),
		Offset(x, y)
	{
	}
};

class BlockDataRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;
	const BlockData *const TexturePositions;
	const size_t TexturePositionsSize;

	BlockDataRenderer(ITexture *texture, const BlockData *const positions, const size_t &size) :
		Texture(texture),
		TexturePositions(positions),
		TexturePositionsSize(size)
	{
	}

	int GetTypeData(const int &data) { return data; }

	virtual void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		byte data = block.Data;

		if (data >= TexturePositionsSize)
			data = 0; // FIX?

		renderer->Draw(Box(Texture).SetAll(TexturePositions[data].Offset));
	}
};